<template>
    <div>
        <el-button @click="drawlu=true" type="primary" style="margin-left: 16px;" >
            录入成绩
        </el-button>
        <el-drawer
                title="我是标题"
                :visible.sync="drawlu"
                :with-header="false"
                size="70%">
        </el-drawer>
        <el-table :data="examList" style="width: 100%" border stripe><!--这里是要添加API接口的-->
            <el-table-column type="index"></el-table-column><!--索引列-->
            <!--            <el-table-column prop="contestId" label="竞赛ID" width="100"></el-table-column>-->
            <el-table-column prop="examName" label="考试名" width="600"></el-table-column>
            <el-table-column prop="examId" label="考试号" width="800"></el-table-column>
            <el-table-column  label="操作" width="180">
                <template slot-scope="scope">
                    <el-button type="primary"  size="mini" @click="drawer=true" style="margin-left: 16px;">查看详情</el-button><!--scope.row表示当前这行的用户，用他的id去查询更新-->
                </template>
            </el-table-column>
        </el-table>
        <el-dialog
                title="添加考试"
                :visible.sync="addContestVisible"
                width="40%"
                @close="addDialogClosed">
            <el-form ref="addFormRef" :model="addForm"  label-width="100px">
                <el-form-item label="考试名称" prop="examName">
                    <el-input v-model="addForm.examName" ></el-input>
                </el-form-item>
                <el-form-item label="考试号" prop="examId">
                    <el-input v-model="addForm.examId" ></el-input>
                </el-form-item>
            </el-form>
            <!--底部按钮区-->
            <span slot="footer" class="dialog-footer">
                <el-button @click="addContestVisible = false">取 消</el-button><!--点击取消隐藏对话框-->
                <el-button type="primary" @click="addCourse">确 定</el-button><!--点击确定也会隐藏对话框-->
            </span>
        </el-dialog>
        <el-drawer
                title="我是标题"
                :visible.sync="drawer"
                :with-header="false"
                size="60%">
        </el-drawer>

    </div>
</template>

<script>
    export default {
        name: "myStuGradeAll",
        data(){
            return{
                drawlu: false,
                classList:[],
                examList: [],
                addContestVisible:false,
                addForm:{},
                drawer: false,
                innerDrawer: false,
            }
        },
        created(){
            this.getExamList()
        },
        methods:{
            async getExamList() {
                const {data: res} = await this.$http.get('getExam')
                this.examList = res.data
            },
        }
    }
</script>

<style scoped>

</style>